package com.sinven.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.sinven.pojo.User;
import com.sinven.service.UserService;


@Controller
public class albumController {
	@Autowired
	private UserService userService;

	@RequestMapping({ "album" })
	public String article() {
		return "pages/album";
}
	@RequestMapping({ "updateuser" })
	@ResponseBody
	public boolean UpdateUser(User user,HttpSession session) {
		User user1=(User)session.getAttribute("user");
		try {
			user.setU_id(user1.getU_id());
			boolean bool=userService.UpdateUser(user);
			if(bool) {
				return true;
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return false;
	}
	
	@RequestMapping({ "htupdateuser" })
	@ResponseBody
	public boolean HTUpdateUser(User user,HttpSession session) {
		
		try {
			
			boolean bool=userService.HTUpdateUser(user);
			if(bool) {
				return true;
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return false;
	}
	}
